#######################################
###########CONTENT ANALYSIS############
#######################################


#LOAD /INSTALL PACKAGES
pacman::p_load(
  foreign, reshape2, ggplot2, tidyverse, plyr, dplyr, ggpubr 
)

setwd(dirname(rstudioapi::getActiveDocumentContext()$path))

#FIGURE1#
figure1app<-read.dta("Figure1app.dta")

figure1appr<-rename(figure1app, c("PERCENTEXPAPSRn"="APSR", "PERCENTEXPEJPRn"="EJPR"))

figure1appm <- melt(figure1appr, id = "YEAR")
figure1appm <-rename(figure1appm, c("variable"="Journal"))

figure<-ggplot(data = figure1appm, aes(x = YEAR, y = value, colour = Journal, linetype = Journal, shape = Journal, group = Journal)) +
  scale_x_continuous(name="Years", limits=c(2000, 2019), breaks=seq(2000, 2019, by=1)) +
  scale_y_continuous(name="Pertanges of articles", limits=c(0, 20), breaks=seq(0, 20, by=2)) +
  theme_bw() + theme(legend.position="bottom") +
  theme(axis.text.x = element_text(angle = 45, vjust = 1, hjust=1)) +
  geom_line(aes(linetype=Journal), size = 0.8) +
  scale_linetype_manual(values=c("solid", "dashed")) +
  scale_color_manual(values=c("firebrick2", "cornflowerblue")) +
  theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank(),
        panel.background = element_blank(), axis.line = element_line(colour = "black")) +
  theme(axis.text=element_text(size=14),
        axis.title=element_text(size=14,face="bold")) +
  theme(legend.title = element_text(size = 14),
    legend.text = element_text(size = 14)
  )

ggsave("figureApp1.png", dpi = 600)
